<style lang="less" scoped>
    .glue {
        width: 100%;
        height: auto;
        overflow: hidden;
        text-align: center;
        padding: 8px;
        display: flex;
    }
</style>
<template>
    <div class="glue">
        <card-table
            table="2"
            cardtitle="涂胶工艺参数库"
            :columns="columns"
            :selectList="selectList"
            :defaultSelete="defaultSelete"
            :searchForm="searchForm"
            :formItem="formItem"
            :addbtn="false"
            @refresh="refresh"
            @on-current-change="onCurrentChange"
            :data="data">
            <div slot="elmtable">
                <el-table-column
                    label="">
                    <template slot-scope="scope">
                        <img :src="scope.row.tj_photo" alt="" width="30px" height="30px" style="cursor: pointer;margin: 0 auto;" @click="showimg(scope.row.tj_photo)">
                    </template>
                </el-table-column>
                <!--<el-table-column
                    fixed="right"
                    label="操作"
                    width="80">
                    <template slot-scope="scope">
                        <Button type="text" @click="xqclick(scope.row)">详情</Button>
                    </template>
                </el-table-column>-->
            </div>
        </card-table>
    </div>
</template>
<script>
    import CardTable from '../components/cardTable.vue'
    import MyCard from '../components/myCard.vue'
    import gluedata from './gluedata.js'
    export default {
        name: 'glue',
        data () {
            return {
                columns: [
                    {
                        title: '产品编号',
                        key: 'nub',
                        width: 160,
                        fixed: 'left'
                    },
                    {
                        title: '产品名称',
                        key: 'name',
                        width: 160,
                        fixed: 'left'
                    },
                    {
                        title: '温度',
                        key: '',
                        children: [
                            {
                                title: '加热棒1',
                                key: 'tj_jrb1',
                                width: 80
                            },
                            {
                                title: '加热棒2',
                                key: 'tj_jrb2',
                                width: 80
                            },
                            {
                                title: '加热棒3',
                                key: 'tj_jrb3',
                                width: 80
                            },
                            {
                                title: '加热棒4',
                                key: 'tj_jrb4',
                                width: 80
                            },
                            {
                                title: '预烘箱1',
                                key: 'tj_yhx1',
                                width: 80
                            },
                            {
                                title: '预烘箱2',
                                key: 'tj_yhx2',
                                width: 80
                            },
                            {
                                title: '大烘箱',
                                key: 'tj_wddhx',
                                width: 80
                            }
                        ]
                    },
                    {
                        title: '一次上胶',
                        key: '',
                        children: [
                            {
                                title: '电机频率',
                                key: '',
                                children: [
                                    {
                                        title: '进带',
                                        key: 'tj_jd',
                                        width: 80
                                    },
                                    {
                                        title: '胶棍',
                                        key: 'tj_jg',
                                        width: 80
                                    },
                                    {
                                        title: '大烘箱',
                                        key: 'tj_dhx',
                                        width: 80
                                    },
                                    {
                                        title: '出带',
                                        key: 'tj_cd',
                                        width: 80
                                    }
                                ]
                            },
                            {
                                title: '胶棍刮刀',
                                key: 'tj_jggd',
                                width: 80
                            },
                            {
                                title: '后刮刀',
                                key: 'tj_hgd',
                                width: 80
                            }
                        ]
                    },
                    {
                        title: '二次上胶',
                        key: '',
                        children: [
                            {
                                title: '电机频率',
                                key: '',
                                children: [
                                    {
                                        title: '进带',
                                        key: 'tj_jd2',
                                        width: 80
                                    },
                                    {
                                        title: '胶棍',
                                        key: 'tj_jg2',
                                        width: 80
                                    },
                                    {
                                        title: '大烘箱',
                                        key: 'tj_dhx2',
                                        width: 80
                                    },
                                    {
                                        title: '出带',
                                        key: 'tj_cd2',
                                        width: 80
                                    }
                                ]
                            },
                            {
                                title: '胶棍刮刀',
                                key: 'tj_jggd2',
                                width: 80
                            },
                            {
                                title: '后刮刀',
                                key: 'tj_hgd2',
                                width: 80
                            }
                        ]
                    },
                    {
                        title: '品质要求',
                        key: '',
                        children: [
                            {
                                title: '尺寸',
                                key: 'tj_chic',
                                width: 160
                            },
                            {
                                title: '胶块情况',
                                key: 'tj_jkqk',
                                width: 160
                            },
                            {
                                title: '烫情况',
                                key: 'tj_tqk',
                                width: 160
                            },
                            {
                                title: '绒毛',
                                key: 'tj_rm',
                                width: 160
                            }
                        ]
                    },
                    {
                        title: '图号',
                        key: 'version',
                        width: 80,
                        fixed: 'right'
                    }
                ],
                data: [],
                selectList: [
                    {
                        label: '产品编号',
                        value: 'nub'
                    },
                    {
                        label: '产品名称',
                        value: 'name'
                    },
                    {
                        label: '图号',
                        value: 'version'
                    }
                ],  //  搜索下拉列表
                defaultSelete: 'nub',  //  搜索下拉列表默认值
                searchForm: {
                    'nub': '',
                    'name': '',
                    'tj_jrb1': '',
                    'tj_jrb2': '',
                    'tj_jrb3': '',
                    'tj_jrb4': '',
                    'tj_yhx1': '',
                    'tj_yhx2': '',
                    'tj_wddhx': '',
                    'tj_jd': '',
                    'tj_dhx': '',
                    'tj_cd': '',
                    'tj_jggd': '',
                    'tj_hgd': '',
                    'tj_jd2': '',
                    'tj_dhx2': '',
                    'tj_cd2': '',
                    'tj_jggd2': '',
                    'tj_hgd2': '',
                    'version': ''
                },  //  表单初始值
                formItem: [
                    {
                        label: '产品编号',
                        key: 'nub',
                        placeholder: '输入产品编号'
                    },
                    {
                        label: '产品名称',
                        key: 'name',
                        placeholder: '输入产品名称'
                    },
                    {
                        label: '加热棒1温度',
                        key: 'tj_jrb1',
                        placeholder: '输入加热棒1温度'
                    },
                    {
                        label: '加热棒2温度',
                        key: 'tj_jrb2',
                        placeholder: '输入加热棒2温度'
                    },
                    {
                        label: '加热棒3温度',
                        key: 'tj_jrb3',
                        placeholder: '输入加热棒3温度'
                    },
                    {
                        label: '加热棒4温度',
                        key: 'tj_jrb4',
                        placeholder: '输入加热棒4温度'
                    },
                    {
                        label: '预烘箱1温度',
                        key: 'tj_yhx1',
                        placeholder: '输入预烘箱1温度'
                    },
                    {
                        label: '预烘箱2温度',
                        key: 'tj_yhx2',
                        placeholder: '输入预烘箱2温度'
                    },
                    {
                        label: '大烘箱温度',
                        key: 'tj_wddhx',
                        placeholder: '输入大烘箱温度'
                    },
                    {
                        label: '进带',
                        key: 'tj_jd',
                        placeholder: '输入一次上胶进带参数'
                    },
                    {
                        label: '胶棍',
                        key: 'tj_jg',
                        placeholder: '输入一次上胶胶棍参数'
                    },
                    {
                        label: '大烘箱',
                        key: 'tj_dhx',
                        placeholder: '输入一次上胶大烘箱参数'
                    },
                    {
                        label: '出带',
                        key: 'tj_cd',
                        placeholder: '输入一次上胶出带参数'
                    },
                    {
                        label: '胶棍刮刀',
                        key: 'tj_jggd',
                        placeholder: '输入一次上胶胶棍刮刀参数'
                    },
                    {
                        label: '后刮刀',
                        key: 'tj_hgd',
                        placeholder: '输入一次上胶后刮刀参数'
                    },
                    {
                        label: '进带',
                        key: 'tj_jd2',
                        placeholder: '输入二次上胶进带参数'
                    },
                    {
                        label: '胶棍',
                        key: 'tj_jg2',
                        placeholder: '输入二次上胶胶棍参数'
                    },
                    {
                        label: '大烘箱',
                        key: 'tj_dhx2',
                        placeholder: '输入二次上胶大烘箱参数'
                    },
                    {
                        label: '出带',
                        key: 'tj_cd2',
                        placeholder: '输入二次上胶出带参数'
                    },
                    {
                        label: '胶棍刮刀',
                        key: 'tj_jggd2',
                        placeholder: '输入二次上胶胶棍刮刀参数'
                    },
                    {
                        label: '后刮刀',
                        key: 'tj_hgd2',
                        placeholder: '输入二次上胶后刮刀参数'
                    },
                    {
                        label: '图号',
                        key: 'version',
                        placeholder: '输入产品最新图号'
                    }
                ],  //  搜索表单item
                current: null
            }
        },
        methods: {
            showimg (url) {
            },
            xqclick (row) {
                console.log('当前点击事件', row)
            },
            refresh () {
                this.http.getGycs(this, {}, 'tujiao/getAllTujiao')
            },
            onCurrentChange (current) {
                console.log('current', current)
                this.current = current
            }
        },
        components: {
            CardTable,
            MyCard
        },
        mounted: function () {
            this.http.getGycs(this, {}, 'tujiao/getAllTujiao')
        }
    };
</script>
